import sys
import os
import logging
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.abspath(os.path.dirname(curPath) + os.path.sep + ".")
sys.path.append(rootPath)
sys.path.append(os.path.join(curPath,'commDriver'))
sys.path.append(os.path.join(curPath,'data'))
logging.info(sys.path)

import pytest
import Set_up
import argparse

# pytest运行
if __name__ == "__main__":
    # parser = argparse.ArgumentParser()
    # parser.description='This is the input if you need '
    # parser.add_argument("--drive_type", help="this is parameter to select drive_type", dest="drive_type", type=str, default="USE_TS_VIRTUAL_DEVICE")
    # args = parser.parse_args()

    # Set_up.drive_type = args.drive_type

    # logging.info(sys.argv[0] )  ###脚本名
    # # logging.info(sys.argv[1] )  ###参数数组
    # 还需要添加根据当前命令行参数输入内容选择是否使用Set_up中的数据,如果命令行中有参数,则使用命令行命令,反之使用setup中的参数作为配置项
    logging.info('XXXXX'*30)
    logging.info(rootPath)
    logging.info('XXXXX'*30)
    # pytest.main(['-s', '-v', '-q', '--alluredir', './reports'])
    pytest.main()
